﻿<shared:UserControlBase x:Class="Bymed.SpineScan.WPF.CustomizedUserControl.TestResultRegularChartUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:userControl="clr-namespace:Bymed.SpineScan.WPF.CustomizedUserControl"
             xmlns:shared="clr-namespace:Bymed.SpineScan.WPF.Shared"
             x:Name="CurrentUserControl"
             mc:Ignorable="d" 
             d:DesignHeight="60" d:DesignWidth="800">
    <UserControl.Resources>
        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}" />
    </UserControl.Resources>
    <Border BorderThickness="1" BorderBrush="#26416f">
        <Border.Style>
            <Style TargetType="{x:Type Border}">
                <Setter Property="Height" Value="38" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding DisplayLineTrend, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="True">
                        <Setter Property="Height" Value="105" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Border.Style>
        <Grid>
            <Grid.ColumnDefinitions>
                <!-- Displayed Title & Result  -->
                <ColumnDefinition Width="Auto" />
                <!-- Chart -->
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid>
                <!-- Displayed Title & Result for regular test items. NOT for ScoliosisATI & Kyphosis. -->
                <Grid.Style>
                    <Style TargetType="{x:Type Grid}">
                        <Setter Property="Visibility" Value="Visible" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding TestItemName}" Value="ScoliosisATI">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Grid.Style>
                <Grid.ColumnDefinitions>
                    <!-- Test Item Title -->
                    <ColumnDefinition />
                    <!-- First Test Result Label -->
                    <ColumnDefinition Width="Auto" />
                    <!-- First Test Result -->
                    <ColumnDefinition Width="Auto" />
                    <!-- Second Test Result Label -->
                    <ColumnDefinition Width="Auto" />
                    <!-- Second Test Result -->
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <!-- Test Item Title or Test Date -->
                <TextBlock Margin="0" Width="100" VerticalAlignment="Center" TextAlignment="Center">
                    <TextBlock.Style>
                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                            <Setter Property="Text" Value="{Binding TestItemTitle}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding DisplayTestDateInstead, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="True">
                                    <Setter Property="Text" Value="{Binding TestDateDisplay}" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
                <Border Grid.Column="1" Width="38" Background="{StaticResource TestReportMainBackgroundBrush}">
                    <TextBlock Foreground="White" Text="{Binding FirstTestResultLabel}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <!-- First Test Result -->
                <TextBlock Grid.Column="2" Width="38" VerticalAlignment="Center" TextAlignment="Center">
                    <TextBlock.Style>
                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                            <Setter Property="Text" Value="{Binding FirstTestResult, StringFormat={}{0}°}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding FirstTestResult}" Value="{x:Null}">
                                    <Setter Property="Visibility" Value="Hidden" />
                                </DataTrigger>
                                <DataTrigger Binding="{Binding FirstTestResult}" Value="-1">
                                    <Setter Property="Text" Value="NA" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
                <Border Grid.Column="3" Width="38" Background="{StaticResource TestReportMainBackgroundBrush}">
                    <TextBlock Foreground="White" Text="{Binding SecondTestResultLabel}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <!-- Second Test Result -->
                <Border Grid.Column="4" Width="38" BorderThickness="0,0,1,0" BorderBrush="{StaticResource TestReportMainBackgroundBrush}">
                    <TextBlock VerticalAlignment="Center" TextAlignment="Center">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                <Setter Property="Text" Value="{Binding SecondTestResult, StringFormat={}{0}°}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding SecondTestResult}" Value="{x:Null}">
                                        <Setter Property="Visibility" Value="Hidden" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding SecondTestResult}" Value="-1">
                                        <Setter Property="Text" Value="NA" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </Border>
            </Grid>
            <Grid>
                <!-- Displayed Title & Result for ScoliosisATI & Kyphosis. NOT for regular test items. -->
                <Grid.Style>
                    <Style TargetType="{x:Type Grid}">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding TestItemName}" Value="ScoliosisATI">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Grid.Style>
                <Grid.ColumnDefinitions>
                    <!-- Test Item Title -->
                    <ColumnDefinition Width="120" />
                    <!-- Formatted Test Result -->
                    <ColumnDefinition Width="80" />
                </Grid.ColumnDefinitions>
                <Border Background="{StaticResource TestReportMainBackgroundBrush}">
                    <TextBlock Foreground="White" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                <Setter Property="Text" Value="{Binding TestItemTitle}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding DisplayTestDateInstead, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="True">
                                        <Setter Property="Text" Value="{Binding TestDateDisplay}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </Border>
                <Border Grid.Column="1" BorderThickness="0,0,1,0" BorderBrush="{StaticResource TestReportMainBackgroundBrush}">
                    <TextBlock Text="{Binding FormattedTestResult}" VerticalAlignment="Center" TextAlignment="Center" />
                </Border>
            </Grid>
            <Grid Grid.Column="1" Margin="15,2,15,2">
                <!-- First Chart. This will NOT be displayed for Kyphosis.  -->
                <Grid.ColumnDefinitions>
                    <ColumnDefinition>
                        <ColumnDefinition.Style>
                            <Style TargetType="{x:Type ColumnDefinition}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <Setter Property="Width" Value="0" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ColumnDefinition.Style>
                    </ColumnDefinition>
                    <!-- Separator -->
                    <ColumnDefinition Width="2" />
                    <!-- Second Chart -->
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <!-- Chart -->
                    <RowDefinition />
                    <!-- Start Range Marker -->
                    <RowDefinition Height="Auto" />
                    <!-- Line Chart for ScoliosisATI ONLY -->
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid Grid.RowSpan="2" x:Name="LeftChartContainer">
                    <Grid.ColumnDefinitions>
                        <!-- Unusal Range Indicator -->
                        <ColumnDefinition />
                        <!-- Normal Range Indicator -->
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <!-- Chart -->
                        <RowDefinition />
                        <!-- Range End Marker -->
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <!-- Unusal Range Indicator. It will be Noraml Range Indicator for ScoliosisATI & Body Balance ONLY. -->
                    <Border>
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Setter Property="Background" Value="{StaticResource TestReportUnusualRangeBackgroundBrush}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ReverseBackgroundColor}" Value="True">
                                        <Setter Property="Background" Value="{StaticResource TestReportNormalRangeBackgroundBrush}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                    <!-- Normal Range Indicator. The Width will be calcuated. It will be Unusal Range Indicator for ScoliosisATI & Body Balance ONLY. -->
                    <Border Grid.Column="1">
                        <Border.Width>
                            <MultiBinding Converter="{StaticResource TestResultChartItemWidthConverter}">
                                <Binding ElementName="LeftChartContainer" Path="ActualWidth" />
                                <Binding Path="FirstMaxValue" />
                                <Binding Path="FirstRangeEndValue" />
                            </MultiBinding>
                        </Border.Width>
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Setter Property="Background" Value="{StaticResource TestReportNormalRangeBackgroundBrush}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ReverseBackgroundColor}" Value="True">
                                        <Setter Property="Background" Value="{StaticResource TestReportUnusualRangeBackgroundBrush}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                    <!-- Test Result Label -->
                    <TextBlock Grid.Row="1" Text="{Binding FirstTestResultLabel}">
                        <!-- If remove this empty style definition will cause different Height of two Charts. No root cause identified so far. -->
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}"></Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <!-- Range End Value -->
                    <TextBlock Grid.Column="1" Grid.Row="1" Margin="-10,0,0,0" Text="{Binding FirstRangeEndValue, StringFormat={}{0}°}">
                        <!-- If remove this empty style definition will cause different Height of two Charts. No root cause identified so far. -->
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}"></Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <!-- Chart Series -->
                    <StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                        <!-- Result -->
                        <TextBlock Margin="0,0,3,0" Foreground="{StaticResource TestReportSeriesResultForegroundBrush}" VerticalAlignment="Center">
                            <TextBlock.Style>
                                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                    <Setter Property="Text" Value="{Binding FirstTestResult, StringFormat={}{0}°}" />
                                    <Style.Triggers>
                                        <!-- Will NOT be displayed if the result is 0 -->
                                        <DataTrigger Binding="{Binding FirstTestResult}" Value="0">
                                            <Setter Property="Visibility" Value="Hidden" />
                                        </DataTrigger>
                                        <!-- Will NOT be displayed if the result is -1 -->
                                        <DataTrigger Binding="{Binding FirstTestResult}" Value="-1">
                                            <Setter Property="Visibility" Value="Hidden" />
                                        </DataTrigger>
                                        <!-- Will NOT be displayed if the result is NULL -->
                                        <DataTrigger Binding="{Binding FirstTestResult}" Value="{x:Null}">
                                            <Setter Property="Visibility" Value="Hidden" />
                                        </DataTrigger>
                                        <!-- Will include TestPositionName for ScoliosisATI ONLY. -->
                                        <DataTrigger Binding="{Binding TestItemName}" Value="ScoliosisATI">
                                            <Setter Property="Text">
                                                <Setter.Value>
                                                    <MultiBinding StringFormat="{}{0}{1}°">
                                                        <Binding Path="TestPositionName" />
                                                        <Binding Path="FirstTestResult" />
                                                    </MultiBinding>
                                                </Setter.Value>
                                            </Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </TextBlock.Style>
                        </TextBlock>
                        <!-- Series -->
                        <Border Background="{StaticResource TestReportSeriesBackgroundBrush}" Height="8">
                            <Border.Width>
                                <MultiBinding Converter="{StaticResource TestResultChartItemWidthConverter}">
                                    <Binding ElementName="LeftChartContainer" Path="ActualWidth" />
                                    <Binding Path="FirstMaxValue" />
                                    <Binding Path="FirstTestResult" />
                                </MultiBinding>
                            </Border.Width>
                        </Border>
                    </StackPanel>
                </Grid>
                <!-- Separator for two Charts -->
                <Border Grid.Column="1" Background="#59629c" />
                <!-- The common Range Start Value. It will NOT be displayed for Kyphosis. -->
                <TextBlock Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Margin="-4,0,0,0" Text="{Binding FirstRangeStartValue, StringFormat={}{0}°}">
                    <TextBlock.Style>
                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                    <Setter Property="Visibility" Value="Hidden" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
                <!-- Second Chart -->
                <Grid Grid.Column="2" Grid.RowSpan="2" x:Name="RightChartContainer">
                    <Grid.ColumnDefinitions>
                        <!-- Normal Range Indicator -->
                        <ColumnDefinition Width="Auto" />
                        <!-- Unusal Range Indicator -->
                        <ColumnDefinition />
                        <!-- Normal Range Indicator. For Kyphosis ONLY. -->
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <!-- Chart -->
                        <RowDefinition />
                        <!-- Range End Marker -->
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <!-- Normal Range Indicator. The Width will be calcuated. It will be Unusal Range Indicator for ScoliosisATI & Body Balance ONLY. -->
                    <Border>
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Setter Property="Background" Value="{StaticResource TestReportNormalRangeBackgroundBrush}" />
                                <!-- For regular test items -->
                                <Setter Property="Width">
                                    <Setter.Value>
                                        <MultiBinding Converter="{StaticResource TestResultChartItemWidthConverter}">
                                            <Binding ElementName="RightChartContainer" Path="ActualWidth" />
                                            <Binding Path="SecondMaxValue" />
                                            <Binding Path="SecondRangeEndValue" />
                                        </MultiBinding>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <!-- For Kyphosis ONLY -->
                                        <Setter Property="Width">
                                            <Setter.Value>
                                                <MultiBinding Converter="{StaticResource TestResultChartItemWidthConverter}">
                                                    <Binding ElementName="RightChartContainer" Path="ActualWidth" />
                                                    <Binding Path="SecondMaxValue" />
                                                    <Binding Path="SecondRangeStartValue" />
                                                </MultiBinding>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding ReverseBackgroundColor}" Value="True">
                                        <Setter Property="Background" Value="{StaticResource TestReportUnusualRangeBackgroundBrush}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                    <!-- Unusal Range Indicator. It will be Normal Range Indicator for ScoliosisATI & Body Balance ONLY. -->
                    <Border Grid.Column="1">
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Setter Property="Background" Value="{StaticResource TestReportUnusualRangeBackgroundBrush}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ReverseBackgroundColor}" Value="True">
                                        <Setter Property="Background" Value="{StaticResource TestReportNormalRangeBackgroundBrush}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                    <!-- Normal Range Indicator. The Width will be calcuated. For Kyphosis ONLY. -->
                    <Border Grid.Column="2" Background="{StaticResource TestReportNormalRangeBackgroundBrush}">
                        <Border.Style>
                            <Style TargetType="{x:Type Border}">
                                <Setter Property="Width" Value="0" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <Setter Property="Width">
                                            <Setter.Value>
                                                <MultiBinding Converter="{StaticResource TestResultChartLastItemWidthConverter}">
                                                    <Binding ElementName="RightChartContainer" Path="ActualWidth" />
                                                    <Binding Path="SecondMaxValue" />
                                                    <Binding Path="SecondRangeEndValue" />
                                                </MultiBinding>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                    <!-- Display Range End Value for regular test items. Display Range Start Value for Kyphosis ONLY. -->
                    <TextBlock Grid.Column="1" Grid.Row="1" Margin="-10,0,0,0">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                <Setter Property="Text" Value="{Binding SecondRangeEndValue, StringFormat={}{0}°}" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <Setter Property="Text" Value="{Binding SecondRangeStartValue, StringFormat={}{0}°}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <!-- Display Range End Value for Kyphosis ONLY. -->
                    <TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding SecondRangeEndValue, StringFormat={}{0}°}" Margin="-10,0,0,0">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <!-- Test Result Label. Will be displayed in different Grid.Column based on test item types. -->
                    <TextBlock Grid.Row="1" Text="{Binding SecondTestResultLabel}" HorizontalAlignment="Right">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                <Setter Property="Grid.Column" Value="1" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <Setter Property="Grid.Column" Value="2" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <!-- Chart Series -->
                    <StackPanel Orientation="Horizontal">
                        <!-- Cross 2 columns for regular test items. Cross 3 columns for Kyphosis ONLY. -->
                        <StackPanel.Style>
                            <Style TargetType="{x:Type StackPanel}">
                                <Setter Property="Grid.ColumnSpan" Value="2" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding TestItemName}" Value="Kyphosis">
                                        <Setter Property="Grid.ColumnSpan" Value="3" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </StackPanel.Style>
                        <!-- Series -->
                        <Border Background="{StaticResource TestReportSeriesBackgroundBrush}" Height="8">
                            <Border.Width>
                                <MultiBinding Converter="{StaticResource TestResultChartItemWidthConverter}">
                                    <Binding ElementName="RightChartContainer" Path="ActualWidth" />
                                    <Binding Path="SecondMaxValue" />
                                    <Binding Path="SecondTestResult" />
                                </MultiBinding>
                            </Border.Width>
                        </Border>
                        <!-- Result -->
                        <TextBlock Margin="3,0,0,0" Foreground="{StaticResource TestReportSeriesResultForegroundBrush}" VerticalAlignment="Center">
                            <TextBlock.Style>
                                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportSmallTextBlock}">
                                    <Setter Property="Text" Value="{Binding SecondTestResult, StringFormat={}{0}°}" />
                                    <Style.Triggers>
                                        <!-- Will NOT be displayed if the result is 0 -->
                                        <DataTrigger Binding="{Binding SecondTestResult}" Value="0">
                                            <Setter Property="Visibility" Value="Hidden" />
                                        </DataTrigger>
                                        <!-- Will NOT be displayed if the result is -1 -->
                                        <DataTrigger Binding="{Binding SecondTestResult}" Value="-1">
                                            <Setter Property="Visibility" Value="Hidden" />
                                        </DataTrigger>
                                        <!-- Will NOT be displayed if the result is NULL -->
                                        <DataTrigger Binding="{Binding SecondTestResult}" Value="{x:Null}">
                                            <Setter Property="Visibility" Value="Hidden" />
                                        </DataTrigger>
                                        <!-- Will include TestPositionName for ScoliosisATI ONLY. -->
                                        <DataTrigger Binding="{Binding TestItemName}" Value="ScoliosisATI">
                                            <Setter Property="Text">
                                                <Setter.Value>
                                                    <MultiBinding StringFormat="{}{0}{1}°">
                                                        <Binding Path="TestPositionName" />
                                                        <Binding Path="SecondTestResult" />
                                                    </MultiBinding>
                                                </Setter.Value>
                                            </Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </TextBlock.Style>
                        </TextBlock>
                    </StackPanel>
                </Grid>
                <userControl:TrendChartUserControl Grid.ColumnSpan="3" Grid.Row="2" Margin="-15,0,0,0" 
                                                   Width="542" DataContext="{Binding}">
                    <userControl:TrendChartUserControl.Style>
                        <Style TargetType="{x:Type userControl:TrendChartUserControl}" BasedOn="{StaticResource TrendChartUserControlStyle}">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding DisplayLineTrend, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="False">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </userControl:TrendChartUserControl.Style>
                </userControl:TrendChartUserControl>
            </Grid>
        </Grid>
    </Border>
</shared:UserControlBase>